package pcloud.client.util;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Date;

public class EventLog
{
    private String logFilePathName;


    public EventLog(String logFilePathName)
    {
        this.logFilePathName = logFilePathName;
    }

    
    public void write(String log, String type) throws IOException
    {
        File fileStream = new File(logFilePathName);
        FileWriter streamWriter = new FileWriter(fileStream);
        String logText = new Date() + " (" + type + ") " + log;
        streamWriter.write(logText);
        streamWriter.flush();
        streamWriter.close();
//        fileStream.close();
    }


}
